package android.skin.change

import android.app.Application
import android.skin.change.loader.CustomSDCardLoader
import skin.support.SkinCompatManager
import skin.support.app.SkinAppCompatViewInflater
import skin.support.utils.Slog

/**
 * Created by ximsfei on 2017/1/10.
 */
class App : Application() {
    override fun onCreate() {
        super.onCreate()
        // 框架换肤日志打印
        Slog.DEBUG = BuildConfig.DEBUG
        SkinCompatManager.withoutActivity(this)
            .addStrategy(CustomSDCardLoader())          // 自定义加载策略，指定SDCard路径
//            .addStrategy(ZipSDCardLoader())             // 自定义加载策略，获取zip包中的资源
            .addInflater(SkinAppCompatViewInflater()) // 基础控件换肤
//            .addInflater(SkinMaterialViewInflater())    // material design
//            .addInflater(SkinConstraintViewInflater())  // ConstraintLayout
//            .addInflater(SkinCardViewInflater())        // CardView
            .setSkinAllActivityEnable(true)                // true: 默认所有的Activity都换肤; false: 只有实现SkinCompatSupportable接口的Activity换肤
            .loadSkin()
    }
}